package com.xiaoshuidi.cloud.framework.pay.core.client.impl.yinlian;

import com.xiaoshuidi.cloud.framework.pay.core.client.PayClientConfig;
import lombok.Data;

import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.validation.constraints.NotEmpty;
import java.util.Set;

/**
 * 银联支付参数
 */
@Data
public class YinlianClientConfig implements PayClientConfig {
    @NotEmpty(message = "appId不能为空")
    private String appId;
    @NotEmpty(message = "appKey不能为空")
    private String appKey;
    @NotEmpty(message = "4位来源编号不能为空")
    private String prefix;
    /**
     * 银联商户号
     */
    @NotEmpty(message = "merchantCode不能为空")
    private String merchantCode;
    /**
     * 银联商户终端号
     */
    @NotEmpty(message = "terminalCode不能为空")
    private String terminalCode;
    /**
     * 签名key
     */
    private String signKey;
    @Override
    public Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator) {
        return validator.validate(this);
    }
}
